import {
  UserController,
  DailyHealthController,
  InternalHealthController,
  SymptomController,
  RelationShipController,
  RoleController,
  ModuleClickController,
} from '@/controller/miniProgram/UserController';
export const RelationShip = [
  /**
   * 关联用户信息
   */
  {
    method: 'post',
    route: '/user/relation',
    controller: RelationShipController,
    action: 'addRelation',
  },
  /**
   * 移除关联用户信息
   */
  {
    method: 'delete',
    route: '/user/relation',
    controller: RelationShipController,
    action: 'removeRelation',
  },
  // 获取亲属下的所有患者用户关系和数据

  {
    method: 'get',
    route: '/user/relation_info',
    controller: RelationShipController,
    action: 'getAllRelationListForUser',
  },

];
export const Symptom = [
  /**
   * 获取症状列表
   */
  {
    method: 'get',
    route: '/symptom',
    controller: SymptomController,
    action: 'findAll',
  },
  /**
   * 新增症状
   */
  {
    method: 'post',
    route: '/symptom',
    controller: SymptomController,
    action: 'addSymptom',
  },
  /**
   * 删除症状
   */
  {
    method: 'delete',
    route: '/symptom',
    controller: SymptomController,
    action: 'removeSymptom',
  },
  /**
   * 更新用户症状
   */
  {
    method: 'post',
    route: '/user/symptom',
    controller: SymptomController,
    action: 'updateSymptomForUser',
  },
];
export const DailyHealth = [
  /**
   * 添加用户监测健康
   */
  {
    method: 'post',
    route: '/user/daily_health',
    controller: DailyHealthController,
    action: 'addDailyHealthForUser',
  },
  /**
   * 表单提交
   */
  // {
  //   method: 'post',
  //   route: '/user/daily_health/form',
  //   controller: DailyHealthController,
  //   action: 'submitFormStatus',
  // },
  /**
   * 删除用户监测健康
   */
  {
    method: 'delete',
    route: '/user/daily_health',
    controller: DailyHealthController,
    action: 'delDailyHealthForUser',
  },
];
export const InternalHealth = [
  /**
   * 更新用户疾病史
   */
  {
    method: 'post',
    route: '/user/internal_health',
    controller: InternalHealthController,
    action: 'updateInternalHealthForUser',
  },
];
export const ModuleClick = [
  /**
   * 获取所有用户模块点击数据
   */
  {
    method: 'get',
    route: '/user/module',
    controller: ModuleClickController,
    action: 'findAll',
  },
  /**
   * 获取用户模块点击数据
   */
  {
    method: 'get',
    route: '/user/module/:id',
    controller: ModuleClickController,
    action: 'getModuleClickCountForUser',
  },
  /**
   * 更新或新增用户模块点击数据
   */
  {
    method: 'post',
    route: '/user/module',
    controller: ModuleClickController,
    action: 'moduleClickForUser',
  },
  /**
   *  删除单个用户模块点击数据
   */
  {
    method: 'delete',
    route: '/user/module',
    controller: ModuleClickController,
    action: 'remoteModuleClickForUser',
  },
];

export const Role = [
  {
    method: 'get',
    route: '/role',
    controller: RoleController,
    action: 'findAll',
  },
];

export const User = [
  {
    method: 'post',
    route: '/user/kinsfolk/relation',
    controller: UserController,
    action: 'updatePhoneOfKinsfolk',
  },
  {
    method: 'post',
    route: '/user/test',
    controller: UserController,
    action: 'test',
  },
  /**
   * 更新用户基本资料
   * ? 如果不放在前面会优先匹配 /user 接口
   */
  {
    method: 'post',
    route: '/user/base_info',
    controller: UserController,
    action: 'updateBaseInfo',
  },
  /**
   * 获取用户列表，支持性别，年龄，用户名，分页
   */
  {
    method: 'get',
    route: '/user',
    controller: UserController,
    action: 'findBySearch',
  },
  {
    method: 'get',
    route: '/user/count',
    controller: UserController,
    action: 'getUserCount',
  },
  /**
   * 根据id获取用户
   *
   * @param {string} id
   */
  {
    method: 'get',
    route: '/user_info',
    controller: UserController,
    action: 'findById',
  },
  {
    method: 'get',
    route: '/user_info/:id',
    controller: UserController,
    action: 'findById',
  },

  /**
   * 添加或者更新用户
   */
  {
    method: 'post',
    route: '/user',
    controller: UserController,
    action: 'addOrUpdate',
  },
  /**
   * 根据id删除用户
   *
   * @param {string} id
   */
  {
    method: 'delete',
    route: '/user/:id',
    controller: UserController,
    action: 'remove',
  },
];
